﻿/**
 *
 * @file FITKAbaqusHDF5AdaptorSection.h
 * @brief 读写HDF5文件的Section类
 * @author fulipeng (fulipengqd@yeah.net)
 * @date 2024-05-31
 *
 */
#ifndef  _FITKABAQUSHDF5ADAPTORSECTION_H__
#define  _FITKABAQUSHDF5ADAPTORSECTION_H__

#include "FITKAbaqusIOHDF5API.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"
#include "FITK_Interface/FITKInterfaceIOHDF5/FITKInterfaceHDF5AdaptorSection.h"

 //前置声明
ForwardDeclarNS(Interface, FITKAbstractSection)
ForwardDeclarNS(Interface, FITKAbaAbastractSection)
ForwardDeclarNS(Interface, FITKAbstractMaterial)
ForwardDeclarNS(Interface, FITKAbaProfile)
ForwardDeclarNS(Interface, FITKSectionAssign)

namespace IO
{
    /**
     * @brief HDF5 Assembly 读写适配器
     * @author fulipeng (fulipengqd@yeah.net)
     * @date 2024-05-31
     */
    class FITKABAQUSIOHDF5API FITKAbaqusHDF5AdaptorSection : public FITKInterfaceHDF5AdaptorSection
    {
    public:
        explicit FITKAbaqusHDF5AdaptorSection() = default;
        virtual ~FITKAbaqusHDF5AdaptorSection() = default;

        /**
         * @brief 获取适配器数据类型名
         * @return 适配器数据类型名
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-31
         */
        QString getAdaptorClass() override;

        /**
         * @brief 适配器读取
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-31
         */
        bool adaptR() override;

        /**
         * @brief 适配器写出
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-31
         */
        bool adaptW() override;

        /**
         * @brief 设置指派器和梁剖面
         * @param assign 指派器
         * @param profile 梁剖面
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-31
         */
        void setSectionAssignAndProfile(Interface::FITKSectionAssign* assign, Interface::FITKAbaProfile* profile);

    protected:
        /**
         * @brief 读取截面属性
         * @param section 截面
         * @param h5Group
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-04
         */
        virtual bool readSection(Interface::FITKAbstractSection* section, H5::Group& h5Group) override;

        /**
         * @brief 读取均匀实体截面属性
         * @param section 截面
         * @param h5Group
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-04
         */
        bool readSolidHomogeneousSection(Interface::FITKAbstractSection* section, H5::Group& h5Group);

        /**
         * @brief 读取均匀壳截面属性
         * @param section 截面
         * @param h5Group
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-04
         */
        bool readShellHomogeneousSection(Interface::FITKAbstractSection* section, H5::Group& h5Group);

        /**
         * @brief 读取梁截面属性
         * @param section 截面
         * @param h5Group
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-04
         */
        bool readBeamSection(Interface::FITKAbstractSection* section, H5::Group& h5Group);

        /**
         * @brief 读取截面属性 暂不支持
         * @param section 截面
         * @param h5Group
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-04
         */
        bool readTrussSection(Interface::FITKAbstractSection* section, H5::Group& h5Group);


        /**
         * @brief 写出I型梁截面属性
         * @param section 截面
         * @param h5Group
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-04
         */
        bool readBeamSectionProfileI(Interface::FITKAbstractSection* section, H5::Group& h5Group);

        /**
         * @brief 写出截面属性
         * @param section 截面
         * @param h5Group
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-04
         */
        virtual bool writeSection(Interface::FITKAbstractSection* section, H5::Group& h5Group) override;

        /**
         * @brief 写出均匀实体截面属性
         * @param section 截面
         * @param h5Group
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-04
         */
        bool writeSolidHomogeneousSection(Interface::FITKAbstractSection* section, H5::Group& h5Group);

        /**
         * @brief 写出均匀壳截面属性
         * @param section 截面
         * @param h5Group
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-04
         */
        bool writeShellHomogeneousSection(Interface::FITKAbstractSection* section, H5::Group& h5Group);

        /**
         * @brief 写出梁截面属性
         * @param section 截面
         * @param h5Group
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-04
         */
        bool writeBeamSection(Interface::FITKAbstractSection* section, H5::Group& h5Group);

        /**
         * @brief 写出截面属性 暂不支持
         * @param section 截面
         * @param h5Group
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-04
         */
        bool writeTrussSection(Interface::FITKAbstractSection* section, H5::Group& h5Group);

        /**
         * @brief 写出I型梁截面属性
         * @param section 截面
         * @param h5Group
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-04
         */
        bool writeBeamSectionProfileI(Interface::FITKAbaProfile* profile, H5::Group& h5Group);


    };

    Register2FITKIOAdaptorFactory(HDF5, Interface::FITKAbaAbastractSection, FITKAbaqusHDF5AdaptorSection)

}

#endif
